package com.tanhua.dubbo.server.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexType;
import org.springframework.data.mongodb.core.index.GeoSpatialIndexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 *
 * @ClassName: UserLocation_Mongo
 * @Author:王晨晗
 * @Description: 地理位置信息
 * @Date: 2022/01/08/14:17
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "user_location")
public class UserLocation_Mongo implements Serializable {

    private static final long serialVersionUID = 6003154687820874230L;

    private ObjectId id;
    private Long userId;    //用户id

    @GeoSpatialIndexed(type = GeoSpatialIndexType.GEO_2DSPHERE)
    private GeoJsonPoint location;      //地理位置

    private String address; //位置描述
    private Long created;//创建时间
    private Long updated; //更新时间
    private Long lastUpdated; //上次更新时间
}
